<?php
$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'资讯管理'=>array($this->pre_module_url.'/news/admin'),
	'分类管理'=>array($this->pre_module_url.'/newsCat/admin'),
);
?>



<!--排序表单 -->
<?php $form=$this->beginWidget('CActiveForm', array(
	'action'=>$this->pre_module_url.'/newsCat/update',
	'method'=>'post',
)); ?>
	 <ul class="main_class">
	 	<li class="main_type">
			<div class="cate_hd mem_bgx">
				<ul class="hd f_r t_c">
					<li class="w_300 f_l">分类名称</li>
					<li class="w_40 f_l">&nbsp;</li>
					<li class="w_180 f_l">移动</li>
					<li class="w_180 f_l">查看分类下宝贝</li>
					<li class="w_120 f_l">操作</li>
				</ul>
			</div>
	 	</li>
	 	<div class="cate_th">
	 		<span class="c_666 f_r">注意：添加分类图片的规格为：186*27px</span>
	 		<span class="mem_bgx link_btn mr5">
	 			<a class="mem_bgx link_btn click" href="javascript:" onclick="addCate('0')" title="">添加一级分类</a>
	 			<b class="mem_bgx left"></b><b class="mem_bgx right"></b>
	 		</span>
	 		<span class="mem_bgx link_btn mr5">
	 			<a class="mem_bgx link_btn click" href="javascript:" onclick="submit()" title="">保存</a>
  				<b class="mem_bgx left"></b><b class="mem_bgx right"></b>
  			</span>
	 	</div>
		<?php $this->widget('zii.widgets.CListView', array(
			'dataProvider'=>$model->search(),
			'itemView'=>'_view',
			'emptyText'=>"",
			'enablePagination'=>'false',
			'template'=>'{items}',
			'summaryText'=>'',
			'tagName'=>'ul',
			'htmlOptions'=>array('class'=>'type_list')
		)); 
		?>
	</ul>
<?php $this->endWidget(); ?>
	 	
	 	
<!-- 上传组件 -->
<script src="<?php echo Yii::app()->baseUrl;?>/js/jquery.ui.widget.js"></script>  
<script src="<?php echo Yii::app()->baseUrl;?>/js/jquery.iframe-transport.js"></script>  
<script src="<?php echo Yii::app()->baseUrl;?>/js/jquery.fileupload.js"></script>  
<!-- 弹框组件 -->
<link href="/js/artdialog/skins/default.css" rel="stylesheet" />
<script src="/js/artdialog/artDialog.min.js"></script>

<script>  
$(function () {  
	//上传图标
    $('.fileupload').fileupload({  
        dataType: 'json',  
        url: '/Attachment/GetAjax',          
        success: function (json) {            
               // $('#MemType_zmt_pic').attr('value',json.upfile.file);  
            	var a = json.upfile.zat_id;
                $(this).next('input').val(a);
        }  
    });  
    //列表折叠
    $('.fold').toggle(
    	    function(){
        	    $(this).parent().parent().next('.child').show();
        	},
    	    function(){
       		 	$(this).parent().parent().next('.child').hide();
        	}
     ); 
    //移动排序下移
    $('.downlist').live('click',function(){
        var a = $(this).parent().parent().parent();
		a.next('li').after(a);
    });
    //移动排序上移
    $('.uplist').live('click',function(){
        var a = $(this).parent().parent().parent();
		a.prev('li').before(a);
    });
}); 
//弹框@param pid 父ID，@param level 级别
function addCate(pid){
	art.dialog({
	    title: '新建分类',
	    content: '分类名称:<input type="text" id="newtitle" name="name"/>',
	    height: '100px',
	    width: '300px',
	    okValue: '保存',
	    cancelValue: '取消',
	    cancel: function () {},
	    ok:function () {
			var a = $('#newtitle').val();
			window.location.href = "/manage/newsCat/create/pid/"+pid+"/title/"+a;
		}
	});
}
</script> 

